package com.nulp.asu.generator;

import com.nulp.asu.generator.amodel.ABlock;
import com.nulp.asu.generator.model.*;
import com.nulp.asu.generator.type.BlockType;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Lyubomyr_Dzyurak on 10/31/2014.
 */
public class BlockFactory {
    private Map<BlockType, ABlock> blockMap;

    public BlockFactory(){
        blockMap = new HashMap();
        blockMap.put(BlockType.ONE_CHOOSE, new OneChoose());
        blockMap.put(BlockType.MULTI_CHOOSE, new MultiChoose());
        blockMap.put(BlockType.ONE_LINE, new OneLine());
        blockMap.put(BlockType.MULTI_LINE, new MultiLine());
        blockMap.put(BlockType.CODE_SHEET, new CodeSheet());
    }

    public ABlock getBlockByType(BlockType blockType) {
        return blockMap.get(blockType);
    }
}
